<?php
/**
 * A library functions
 * @author Can.Nguyen
 */
class CMS_Lib
{

    public static function getThumbnailYoutube($entryId)
    {
        $youtube = new Zend_Gdata_YouTube ( );
        try
        {
            $entry = $youtube->getVideoEntry ( $entryId );
        }
        catch ( Zend_Gdata_App_Exception $ex )
        {
            return null;
        }
        
        $thumbs = $entry->getVideoThumbnails ();
        return $thumbs [0] ['url'];
    }
}